


// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('girlAndBoyPercentage'));
// 绘制图表
myChart.setOption({
    tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b}: {c} ({d}%)'
    },
    
    series: [
        {
            name: '男女比例',
            type: 'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                show: false,
                position: 'center'
            },
            emphasis: {
                label: {
                    show: true,
                    fontSize: '30',
                    fontWeight: 'bold'
                }
            },
            labelLine: {
                show: false
            },
            data: [
                {value: 335, name: '男生'},
                {value: 310, name: '女生'}
                
            ]
        }
    ]
});

var myChart2 = echarts.init(document.getElementById('city'));


myChart2.setOption({
    title: {
        text: '城市分布',
        top:'bottom',
        left: 'center'
    },
    tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b} : {c} ({d}%)'
    },
    series: [
        {
            name: '半径模式',
            type: 'pie',
            radius: [10, 80],
            center: ['50%', '50%'],
            roseType: 'radius',
            label: {
                show: false
            },
            emphasis: {
                label: {
                    show: true
                }
            },
            data: [
                {value: 10, name: '郑州'},
                {value: 5, name: '驻马店'},
                {value: 15, name: '平顶山'},
                {value: 25, name: '石家庄'},
                {value: 20, name: '漯河'},
                {value: 35, name: '周口'},
                {value: 30, name: '开封'},
                {value: 40, name: '南阳'}
            ]
        }
    ]
})




























